package com.charlotte.study.gupao.prototype.deep.json;

import java.util.ArrayList;
import java.util.List;

/**
 * @author junjie.ding
 * @date 2020/3/2
 */
public class main {

    public static void main(String[] args) {

        ConcretePrototype prototype = new ConcretePrototype();
        prototype.setAge(18);
        prototype.setName("李四");

        List<String> hobbies = new ArrayList<String>();
        hobbies.add("书法");
        hobbies.add("game");
        prototype.setHobbies(hobbies);

        System.out.println(prototype);

        ConcretePrototype clone = prototype.deepClone();

        System.out.println(clone);

        clone.getHobbies().add("电脑游戏");

        System.out.println(prototype);
        System.out.println(clone);

    }
}
